package top.system.dept.service;

import java.util.Map;

/**
 * @ClassName: MailServiceAsny
 * @Author: Amosen
 * @Since: 2021/5/30
 */
public class MailServiceAsyn implements Runnable {

    MailService mailService = new MailService();

    private String subject;

    private String toUser;

    private Map<String, Object> contextDatas;

    private String templateName;

    public MailServiceAsyn(String subject, String toUser, Map<String, Object> contextDatas, String templateName) {
        this.subject = subject;
        this.toUser = toUser;
        this.contextDatas = contextDatas;
        this.templateName = templateName;
    }

    @Override
    public void run() {
        mailService.sendMail(subject, toUser, contextDatas, templateName);
    }
}
